package com.itheima.demo1;

public class Xunhuanshujuhe {
    public static void main(String[] args){
        int sum = 0;
        int sun = 0;
        int a = 0;
        int b = 0;
        for(int i = 1 ;i <= 100;i++){
            if(i % 2 == 0){
                sum += i;
                a++;
            }else{
                sun += i;
                b++;
            }
        }
        System.out.println("1-100之间的偶数和为" + sum);
        System.out.println("1-100之间的偶数个数为" + a);
        System.out.println("1-100之间的奇数和为" + sun);
        System.out.println("1-100之间的奇数个数为" + b);
    }
}
